#include<iostream>
using namespace std;


class A
{
    int x;
public:
    A(int x)
    {
        this->x = x;
    }
    virtual void fun()
    {
        cout << " x = " << x << endl;
    }
};


class A1 : public A
{
public:
    A1(int x) : A(x)
    {}
    virtual void fun()
    {
        cout << " class A1 " << endl;
    }
};

int main()
{
    A *p;
    A1 *ptr, a1(1);
    p = &a1;
    p->fun();  // 别人 
    return 0;
}